import {
  AutoCompleteFormItemProps,
  CascaderFormItemProps,
  CheckBoxFormItemProps,
  DatePickerFormItemProps,
  EditorFormItemProps,
  InputFormItemProps,
  InputNumberFormItemProps,
  MentionsFormItemProps,
  RadioFormItemProps,
  RangePickerFormItemProps,
  RateFormItemProps,
  SelectFormItemProps,
  SliderFormItemProps,
  SwitchFormItemProps,
  TimePickerFormItemProps,
  TimeRangePickerFormItemProps,
  TransferFormItemProps,
  TreeSelectFormItemProps,
  UploadFormItemProps,
} from '@/components/base/form-item/props/form-item-props'
import { Dayjs } from 'dayjs'
import  { FileProps } from '@/components/base/base-upload/BaseUpload.vue'
import { EditorProps } from '@/components/base/base-editor/editor-config'
import {
  AutoCompleteParams,
  BaseFieldNames,
  CascaderParams,
  CheckBoxParams,
  DatePickerParams,
  InputNumberParams,
  InputParams,
  MentionsParams,
  RadioParams,
  RangePickerParams,
  RateParams,
  SelectParams,
  SliderParams,
  SwitchParams,
  TimePickerParams,
  TimeRangePickerParams,
  TransferParams,
  TreeSelectParams,
} from '@/components/base/form-item/props/form-item-params'

/**
 * 表单项属性
 */
declare type FormItemProps<Entity = any> =
  | AutoCompleteFormItemProps<Entity>
  | CascaderFormItemProps<Entity>
  | CheckBoxFormItemProps<Entity>
  | DatePickerFormItemProps<Entity>
  | RangePickerFormItemProps<Entity>
  | InputFormItemProps<Entity>
  | InputNumberFormItemProps<Entity>
  | MentionsFormItemProps<Entity>
  | RadioFormItemProps<Entity>
  | RateFormItemProps<Entity>
  | SelectFormItemProps<Entity>
  | SliderFormItemProps<Entity>
  | SwitchFormItemProps<Entity>
  | TimePickerFormItemProps<Entity>
  | TransferFormItemProps<Entity>
  | TreeSelectFormItemProps<Entity>
  | UploadFormItemProps<Entity>
  | EditorFormItemProps<Entity>
  | TimeRangePickerFormItemProps<Entity>
/**
 * 表单项参数
 */
declare type FormItemParams =
  | AutoCompleteParams
  | CascaderParams
  | CheckBoxParams
  | DatePickerParams
  | RangePickerParams
  | InputParams
  | InputNumberParams
  | MentionsParams
  | RadioParams
  | RateParams
  | SelectParams
  | SliderParams
  | SwitchParams
  | TimePickerParams
  | TransferParams
  | TreeSelectParams
  | TimeRangePickerParams
  | FileProps
  | EditorProps
/**
 * 表单项类型枚举
 */
enum FormItemTypeEnum {
  // 自动完成
  AUTO_COMPLETE = 'auto-complete',
  // 输入
  INPUT = 'input',
  // 复选
  CHECKBOX = 'checkbox',
  // 切换
  SWITCH = 'switch',
  // 单选
  RADIO = 'radio',
  // 时间选择
  DATE_PICKER = 'date-picker',
  // 时间范围选择
  RANGE_PICKER = 'range-picker',
  // 日期选择
  TIME_PICKER = 'time-picker',
  // 日期范围选择
  TIME_RANGE_PICKER = 'time-range-picker',
  // 多选
  SELECT = 'select',
  // 数字输入
  INPUT_NUMBER = 'input-number',
  // 滑块
  SLIDER = 'slider',
  // 评分
  RATE = 'rate',
  // 上传
  UPLOAD = 'upload',
  // 级联
  CASCADER = 'cascader',
  // 提及
  MENTIONS = 'mentions',
  // 树形选择
  TREE_SELECT = 'tree-select',
  // 富文本
  EDITOR = 'editor',
  // 穿梭
  TRANSFER = 'transfer',
}
/**
 * 数据类型
 */
declare type BaseType =
  | string
  | number
  | boolean
  | bigint
  | undefined
  | object
  | null
  | Array<any>
  | Array<BaseFieldNames>
  | BaseFieldNames

declare type BaseParam = {
  [key: string]: any
}

export type { BaseType, FormItemProps, FormItemParams, BaseParam }
export { FormItemTypeEnum }
